package com.wang.service.impl;

import com.wang.bean.SinglechoiceSubmissionLog;
import com.wang.bean.SysUserEntity;
import com.wang.bean.TestResults;
import com.wang.mapper.SinglechoiceSubmissionLogMapper;
import com.wang.mapper.SysUserMapper;
import com.wang.mapper.TestResultsMapper;
import com.wang.service.TestResultsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestResultsServiceImpl implements TestResultsService {

    @Autowired
    private SinglechoiceSubmissionLogMapper singlechoiceSubmissionLogMapper;

    @Autowired
    private TestResultsMapper testResultsMapper;

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public void addsinglechoicesubmissionlog(SinglechoiceSubmissionLog singlechoiceSubmissionLog) {
        singlechoiceSubmissionLogMapper.addsinglechoicesubmissionlog(singlechoiceSubmissionLog);
    }

    @Override
    public TestResults findTestPaperResultsByUserSinglechoiceIdExaminationId(TestResults testResults) {
        return testResultsMapper.findTestPaperResultsByUserSinglechoiceIdExaminationId(testResults);
    }

    @Override
    public List<TestResults> findTestPaperResultsByUserId(TestResults testResults) {
        return testResultsMapper.findTestPaperResultsByUserId(testResults);
    }

    @Override
    public List<TestResults> findTestPaperResultsBySinglechoiceId(TestResults testResults) {
        return testResultsMapper.findTestPaperResultsBySinglechoiceId(testResults);
    }

    @Override
    public List<TestResults> findTestPaperResultsAll() {
        return testResultsMapper.findTestPaperResultsAll();
    }

    @Override
    public void addTestPaperResults(TestResults testResults) {
        testResultsMapper.addTestPaperResults(testResults);
    }

    @Override
    public void updateTestPaperResults(TestResults testResults) {
        testResultsMapper.updateTestPaperResults(testResults);
    }

    @Override
    public SysUserEntity selectOneById(Long user_id) {
        return sysUserMapper.selectOneById(user_id);
    }
}
